Fix clobbering bug when hde is specified; QEMU only supports up to hdd, but
authorEwan Mellor <ewan@xensource.com>
Thu, 16 Nov 2006 11:11:17 +0000 (11:11 +0000)
committerEwan Mellor <ewan@xensource.com>
Thu, 16 Nov 2006 11:11:17 +0000 (11:11 +0000)
hde is accepted and writes off the end of some tables.

From Hiromichi Itou <ito@begi.net>.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/ioemu/xenstore.c

index 6c2bc9182a5d02ff71025cff045bc18b34d364bc..21a8ed08b7817c87249035ed458495712742bd15 100644 (file)
@@ -100,7 +100,7 @@ void xenstore_parse_domain_config(int domid)
        if (strncmp(dev, "hd", 2) || strlen(dev) != 3)
            continue;
        hd_index = dev[2] - 'a';
-       if (hd_index > MAX_DISKS)
+       if (hd_index >= MAX_DISKS)
            continue;
        /* read the type of the device */
        if (pasprintf(&buf, "%s/device/vbd/%s/device-type", path, e[i]) == -1)